package org.huntaway.po.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the bmbmg table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="bmbmg"
 */

public abstract class BaseBmbmg  implements Serializable {

	public static String REF = "Bmbmg";
	public static String PROP_BMG = "Bmg";
	public static String PROP_CATEGORY = "Category";
	public static String PROP_ID = "Id";
	public static String PROP_BM = "Bm";


	// constructors
	public BaseBmbmg () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseBmbmg (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String category;

	// many to one
	private org.huntaway.po.Bookmarker bm;
	private org.huntaway.po.Bmgroup bmg;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: category
	 */
	public java.lang.String getCategory () {
		return category;
	}

	/**
	 * Set the value related to the column: category
	 * @param category the category value
	 */
	public void setCategory (java.lang.String category) {
		this.category = category;
	}



	/**
	 * Return the value associated with the column: bm_id
	 */
	public org.huntaway.po.Bookmarker getBm () {
		return bm;
	}

	/**
	 * Set the value related to the column: bm_id
	 * @param bm the bm_id value
	 */
	public void setBm (org.huntaway.po.Bookmarker bm) {
		this.bm = bm;
	}



	/**
	 * Return the value associated with the column: bmg_id
	 */
	public org.huntaway.po.Bmgroup getBmg () {
		return bmg;
	}

	/**
	 * Set the value related to the column: bmg_id
	 * @param bmg the bmg_id value
	 */
	public void setBmg (org.huntaway.po.Bmgroup bmg) {
		this.bmg = bmg;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof org.huntaway.po.Bmbmg)) return false;
		else {
			org.huntaway.po.Bmbmg bmbmg = (org.huntaway.po.Bmbmg) obj;
			if (null == this.getId() || null == bmbmg.getId()) return false;
			else return (this.getId().equals(bmbmg.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}